package com.manage.enter.service.impl;

import java.math.BigDecimal;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;

import org.jdesktop.databuffer.DataRow;
import org.jdesktop.databuffer.DataSet;
import org.jdesktop.databuffer.DataTable;

import com.manage.enter.service.EnterService;

public class EnterServiceImpl implements EnterService {

	public boolean load(String username, String password) {
		if ("test".equals(username) && "test".equals(password)) {
			return true;
		}

		return false;
	}

	@Override
	public DataSet getData(DataSet ds1xx) {
		DataSet ds = new DataSet();
		DataTable dt =ds.createTable("t1");		
		dt.createColumn(String.class, "f1");
		DataRow dr = dt.appendRow();
		dr.setValue("f1", "我们的祖国111");

		dt.createColumn(Integer.class, "f2");
		dt.createColumn(Date.class, "f3");
		dr = dt.appendRow();
		dr.setValue("f2", 123);
		dr = dt.appendRow();
		dr.setValue("f2", 123);
		dr.setValue("f3", new Date());
		
		dt = ds.createTable("t2");
		dt.createColumn(String.class, "f1");
		dr = dt.appendRow();
		dr.setValue("f1", "zifuchu334!#$%^&*()anceshi");
		
		dt.createColumn(BigDecimal.class, "f2");
		dr = dt.appendRow();
		dr.setValue("f1", "dfadsf");
		dr.setValue("f2", new BigDecimal(32432432));
		
		
		Map map = new HashMap();
		map.put("mapkey1", "mapvalue1");		
		ds.setAttr(map);
		
		ds.setDescName("描述");
		ds.setDetailMsg("miaoshumingxi");
		ds.setMsg("信息");
		ds.setMsgKey("msgkey");
		ds.setName("ds");
		ds.setStatus(-1);
		
		
		return ds;
	}
}
